//
//  UserCollectionReusableView.m
//  SugarPile
//
//  Created by LC on 16/2/26.
//  Copyright © 2016年 www.lanou39.蓝鸥科技. All rights reserved.
//

#import "UserCollectionReusableView.h"

@implementation UserCollectionReusableView
- (void)dealloc
{
    [_name release];
    [_view release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 创建图片
        self.name = [[UILabel alloc] init];
//        _name.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.name];
        [_name release];
        
        // view
        self.view = [[UIView alloc] init];
        _view.backgroundColor = [UIColor blackColor];
        [self addSubview:self.view];
        [_view release];
        
    }
    return self;
}

// 布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _name.frame = CGRectMake(20 * W, 5 * H, layoutAttributes.frame.size.width - 20 * W, layoutAttributes.frame.size.height);
    _view.frame = CGRectMake(20 * W, 0, layoutAttributes.frame.size.width - 20 * W, 1 * H);
}

@end
